<template>
  <div>
    <!-- 表格 -->
    <div>
      <el-table
        :data="waiterData"
        height='calc(100vh - 150px)'
        stripe
        style="width: 100%">
        <el-table-column
          prop="id"
          label="编号"
          width="180">
        </el-table-column>
        <el-table-column
          prop="money"
          label="金额"
          width="180">
        </el-table-column>
        <el-table-column
          prop="type"
          label="类型">
        </el-table-column>
        <el-table-column
          prop="description"
          label="描述">
        </el-table-column>
        <el-table-column
          prop="userId"
          label="员工ID">
        </el-table-column>
        <el-table-column
          fixed="right"
          label="凭证"
          width="100">
          <template slot-scope="scope">
            <el-button @click="toCheck(scope.row)" type="text" size="small">查看凭证</el-button>
          </template>
        </el-table-column>
        <el-table-column
          fixed="right"
          label="操作"
          width="100">
          <template slot-scope="scope">
            <el-button @click="toPass(scope.row)" type="text" size="small">已审核</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <!-- 分页 -->
    <div>
      <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page.sync="queryParams.page"
      :page-size="queryParams.pageSize"
      layout="total, prev, pager, next"
      :total="total">
    </el-pagination>
    </div>
  </div>
</template>

<script>
import { mapActions, mapGetters } from 'vuex';
export default {
  data() {
    return {
      queryParams:{
        page:1,
        pageSize:10,
        status:''
      }
    };
  },
  computed: {
    ...mapGetters('waiter',['total','waiterData'])
  },
  methods: {
    ...mapActions('waiter',['findWaiterShou']),
    handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
      },
    handleCurrentChange(val) {
        console.log(`当前页: ${val}`);
        this.queryParams.page=val;
        this.findWaiterShou(this.queryParams)
      }
  },
  created() {
    this.findWaiterShou(this.queryParams)
  },
  mounted() {},
};
</script>
<style lang="less" scoped>
</style>